/**
 * Copyright(c) 2010 Ceno Techonologies Co., Ltd.
 *
 * History:
 *   15-6-18 下午3:50 Created by lyyang
 */
package com.jade.bss.business.bonus;

import java.util.Date;
import java.util.List;

import com.jade.framework.base.criterion.Criteria;
import com.jade.framework.base.util.PagingList;

/**
 * TODO: Must write comments.
 *
 * @author <a href="mailto:lyyang@ceno.cn">lyyang</a>
 * @version 1.0 15-6-18 下午3:50
 */
public interface BonusDao
{
    Bonus add(Bonus bonus);

    Bonus get(long id);

    void update(Bonus bonus);

    void remove(Bonus bonus);

    PagingList<Bonus> query(Criteria criteria);

    List<Bonus> list(Criteria criteria);

    void consume(long id, long amount);

    void addRecord(BonusRecord record);

    BonusRecord getRecord(String receiverType, String receiverId, String orderNo);

    BonusRecord getRecord(long id);

    void updateRecord(BonusRecord record);

    PagingList<BonusRecord> queryRecord(Criteria criteria);

    List<BonusRecord> listRecord(Criteria criteria);

    BonusRecord getRecord(long bonusId, String ownerType, String ownerId);

    void updateRecordStatus(long id, int status);

    long statBonusRecordCount(long id, int status, Date beginDate, Date endDate);
}
